<?php session_start(); ?>
<fieldset class="load-fieldset">
	<label class="labeltabledata">รายชื่อสมาชิก</label>
	<table border="1px solid #666;">
    	<thead>
        	<tr>
            	<th>ชื่อผู้ใช้</th>
                <th>นามสกุล</th>
                <th  style="width: 145px;">ประเภทผู้ใช้</th>
                <th>ดูข้อมูล</th>
                <th>ลบ</th>
            </tr>
        </thead>
        <tbody>
        	<?php
			require_once('../config.ini.php');
		 	$sql="SELECT userdata.user_pk_id, userdata.username, userdata.usersname, userdata.usertype FROM userdata WHERE userdata.userstatus =  '1' AND userdata.userid <> '".$_SESSION["obuserid"]."' ORDER BY userdata.user_pk_id DESC";
			$result=mysql_query($sql);
			while($row=mysql_fetch_array($result)){
			?>
        	<tr>
                <td><?php echo $row['1']; ?></td>
                <td><?php echo $row['2']; ?></td>
                <?php 
					if($row['3']=="1"){ $ut = "สมาชิก"; } elseif ($row['3']=="2") { $ut = "พนักงาน"; } elseif($row['3']=="3") { $ut = "ผู้ดูแลระบบ"; } elseif($row['3']=="4") { $ut = "ผู้บริหาร"; }
				?>
                <td><?php echo $ut; ?></td>
                <td class="td-edit"  style="width: 70px;"><a href="#" onclick="listuser(<?php echo $row["0"]; ?>)"><img width="24px;" height="24px;"  src="../images/info_black-32.png" /></a></td>
                <td class="td-del"><a href="#" onclick="deleteitem('deluser',<?php echo $row["0"]; ?>,'user.php')"><img  width="24px;" height="24px;" src="../images/delete-48.png" /></a></td>
            </tr>
            <?php
			}
			mysql_free_result($result);
			?>
        </tbody>
    </table>
</fieldset>